package com.blb.community_admin.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.blb.community_admin.entity.ZyOwner;
import com.blb.community_admin.service.IZyOwnerService;
import com.blb.community_admin.util.ResponseResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@CrossOrigin
public class ZyOwnerController {
    @Resource
    private IZyOwnerService ownerService;


    @GetMapping("/zyowner/page/fuzzy")
    public ResponseResult<IPage<ZyOwner>> fuzzyPage(Long current, Long size, String ownerNickname, String ownerRealName, String ownerIdCard, String ownerPhoneNumber) {
        IPage<ZyOwner> page = ownerService.fuzzyPage(current, size, ownerNickname, ownerRealName, ownerIdCard, ownerPhoneNumber);
        return ResponseResult.ok(page);
    }

    @PutMapping("/zyowner/update")
    public ResponseResult<String> update(@RequestBody ZyOwner zyOwner) {
        ownerService.updata1(zyOwner);
        return ResponseResult.ok("解绑成功");

    }

}
